﻿SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[bhp_Cms_n_NemoUsers]
AS
BEGIN

	SELECT 
		3000000 + idx as UserId,
		nazwa as Name
	FROM 
		SYS_UZYTKOWNIK
	WHERE
		del = 0
		AND (imie IS NOT NULL OR nazwisko IS NOT NULL)
	UNION
	SELECT
		4000000 + UserID,
		Name
	FROM
		mp_Users

END
GO
